package com.dzl.enterprise.dao;

import com.dzl.base.mapper.BaseMapper;
import com.dzl.enterprise.pojo.WelfareEnterpriseApiGoods;
import com.dzl.enterprise.pojo.query.WelfareEnterpriseApiGoodsQuery;
import com.dzl.enterprise.pojo.vo.WelfareEnterpriseApiGoodsVo;
import com.dzl.goods.pojo.vo.WelfareSkuGoodsVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * api商品(welfare_enterprise_api_goods)表数据库访问层
 * @author liuguanjun
 * @date 2021-11-23 17：03
 */
@Repository
public interface WelfareEnterpriseApiGoodsMapper extends BaseMapper<WelfareEnterpriseApiGoods> {

    /**
     * 查询企业客户api商品列表
     * @param query 查询条件
     * @author liuguanjun
     * @date 2021-11-23 17：03
     */
    List<WelfareEnterpriseApiGoodsVo> selectEnterpriseGoodsList(WelfareEnterpriseApiGoodsQuery query);

    /**
     * 批量删除供应商商品
     * @param ids 商品id
     * @author liuguanjun
     * @date 2021-11-23 17:07:30
     **/
    Integer deleteWelfareEnterpriseGoods(@Param("ids") String ids);

    /**
     * 批量修改供应商商品供应价
     * @param floatingRatio 上浮比例
     * @param id 商品id
     * @author liuguanjun
     * @date 2021-11-23 17:07:30
     **/
    Integer updateWelfareEnterpriseGoodsSupplyPrice(@Param("floatingRatio") Double floatingRatio,@Param("id") Integer  id);

    /**
     * 根据商品id查询sku数据列表
     * @param ids 商品skuid
     * @author liuguanjun
     * @date 2021-11-23 17:50:30
     **/
    List<WelfareSkuGoodsVo> selectGoodsAttrsBySkuIds(@Param("ids") String ids);

    /**
     * 根据商品id查询sku数据列表
     * @param goodsId 商品id
     * @param enterpriseId 企业id
     * @author liuguanjun
     * @date 2021-11-24 09:50:08
     **/
    List<WelfareSkuGoodsVo> selectGoodsAttrsByGoodsIdAndEnterpriseId(@Param("goodsId") Integer goodsId, @Param("enterpriseId") Integer enterpriseId);


}
